<?php
/**
 * 异步验签
 *
 */
include './PayTool.php';

$tool = new  PayTool();
$result = array();
$result['notifySN'] = 'b2d9463cf2384e08b796e01a2553fac9';
$result['sign'] = 'FAE0633F59BC9EAA308302B198B11EC5';
$result['orderInfo'] = '{"msg":"交易成功","code":"0000","totalAmount":"1.11","merOrderID":"Tsmksjrm24v1ef555b83b4","payTime":"2017-12-16 11:12:57.0","merchant":"1003171215265368","orderID":"2017121611121800244095730001","remark":""}';
$sign = $result['sign'];
$checkStr = $tool->sign($result,$tool->pay_key);


// {"msg":"交易成功","code":"0000","payAmount":"20.00","srcReqSN":"edca64da0f8450a87545","payTime":"2018-12-09 18:53:21.0","merchant":"1003181209082894","responeSN":"8C0918520617898276GB","version":"2.0","deviceInfo":"device1"}

$checkStr = strtoupper($checkStr);
if(strcmp($sign, $checkStr) == 0){
    // echo '验签成功';
    // echo 'result '.$tool->paramsToStr($result).'<br>';
    echo '0000';
} else {
    echo '验签失败';
}

?>